<%@ page import="com.webamc.common.enums.Fields" %>
<%@ page import="com.webamc.common.enums.Params" %>
<%@ page import="com.webamc.model.ProductOrder" %>
<%@ page import="static com.webamc.util.CommonUtil.*" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<script type="text/javascript" src="../calendar.js"></script>
<link rel="stylesheet" href="../webamc.css"/>
<div class="action-header">UPDATE INSTALLATION DATA</div>

<%
    ProductOrder u = (ProductOrder) request.getAttribute(Params.BEAN);
    if (u == null) {
%>
No Results to display! <a href="productorder.html?action=browse">click here</a> to browse list.
<%
        return;
    }
%>
<jsp:include page="msgs.jsp"/>
<jsp:include page="popup.jsp"/>
<form action="productorder.html?action=update" method="post">
<table class="browse-table" border="1">
    <col width="20%">
    <col width="80%">

    <tr>
        <td>Product Name</td>
        <td>
            <%
                request.setAttribute(Params.KEY, Fields.PRODUCTNAME);
                request.setAttribute(Params.SEL, u.getProductName());
            %>
            <jsp:include page="productcombo-util.jsp"/>
        </td>
    </tr>
    <tr>
        <td>Product Serial</td>
        <td>
            <input name="<%=Fields.PRODUCTSERIAL%>" value="<%=out(u.getProductSerial())%>"/>
        </td>
    </tr>
    <tr>
        <td>Status</td>
        <td>
            <% request.setAttribute(Params.KEY, Fields.ORDERSTATUS);
                request.setAttribute(Params.SEL, u.getStatus()); %>
            <jsp:include page="combo-util.jsp"/>
        </td>
    </tr>
    <tr>
        <td>Installation date</td>
        <td><input name="<%=Fields.INSTALLATIONDATE%>" onchange="calEndDate(this)" onclick="initCal(this)"
                   value="<%=getDateString(u.getInstallationDate())%>"/></td>
    </tr>
    <tr>
        <td>Invoice Number</td>
        <td><input name="<%=Fields.INVOICENUMBER%>"
                   value="<%=u.getInvoiceNumber()%>"/></td>
    </tr>
    <tr>
        <td>Invoice date</td>
        <td><input name="<%=Fields.INVOICEDATE%>" onclick="initCal(this)"
                   value="<%=getDateString(u.getInvoiceDate())%>"/></td>
    </tr>
    <tr>
        <td>Warranty</td>
        <td><input name="<%=Fields.WARRANTY%>" readonly="readonly" value="<%=u.getWarranty()%>"/></td>
    </tr>
    <tr>
        <td>Ext Warranty</td>
        <td><input name="<%=Fields.EXTWARRANTY%>" value="<%=u.getExtWarranty()%>"/></td>
    </tr>
    <tr>
        <td>Warranty End date</td>
        <td><input name="<%=Fields.WARRANTYENDDATE%>" value="" readonly="readonly"/></td>
    </tr>
    <tr>
        <td>Customer Id</td>
        <td>
            <input readonly="readonly" value="<%=u.getCustomerId()%>" name="<%=Fields.CUSTOMERID%>"
                   onfocus="showMe('customer.html?action=browse', this.name)"/>
            <a href="javascript:showMe('customer.html?action=beforeSearch', '<%=Fields.CUSTOMERID%>')"><%=Params.LIST%>
            </a>
        </td>
    </tr>
    <tr>
        <td>Assignee Id</td>
        <td>
            <input readonly="readonly" name="<%=Fields.ASSIGNEEID%>" value="<%=u.getAssigneeId()%>"
                   onfocus="showMe('user.html?action=browse',this.name)"/>
            <a href="javascript:showMe('user.html?action=browse','<%=Fields.ASSIGNEEID%>')"><%=Params.LIST%>
            </a>
        </td>
    </tr>
    <tr>
        <td>Supervisor Id</td>
        <td>
            <input readonly="readonly" name="<%=Fields.SUPERVISORID%>" value="<%=u.getSupervisorId()%>"
                   onfocus="showMe('user.html?action=browse',this.name)"/>
            <a href="javascript:showMe('user.html?action=browse','<%=Fields.SUPERVISORID%>')"><%=Params.LIST%>
            </a>
        </td>
    </tr>
    <tr>
        <td>Description</td>
        <td>
            <textarea rows="2" cols="20" name="<%=Fields.DESCRIPTION%>"><%=out(u.getDescription())%>
            </textarea>
        </td>
    </tr>
    <tr>
        <td>Remarks</td>
        <td>
            <textarea rows="2" cols="20" name="<%=Fields.REMARKS%>"><%=out(u.getRemarks())%>
            </textarea>
        </td>
    </tr>
    <tr>
        <td colspan="2" align="center">
            <button type="submit">OK</button>
            <a href="productorder.html?action=browse">
                <button type="button">Cancel</button>
            </a>
        </td>
    </tr>

</table>

</form>